package lol.clann.bukkit.pluginboot.util;

import lol.clann.clannboot.annotation.svc.Service;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.InventoryClickEvent;

/**
 * @author pyz
 * @date 2018/8/12 下午4:40
 */
@Service(priority = Integer.MAX_VALUE)
public class EventUtils {

    public boolean isLeftClick(InventoryClickEvent event) {
        return event.getClick().equals(ClickType.LEFT);
    }

    public boolean isShiftLeftClick(InventoryClickEvent event) {
        return event.getClick().equals(ClickType.SHIFT_LEFT);
    }

    public boolean isShift(InventoryClickEvent event) {
        return event.getClick().equals(ClickType.SHIFT_LEFT) || event.getClick().equals(ClickType.SHIFT_RIGHT);
    }

    public boolean isRightClick(InventoryClickEvent event) {
        return event.getClick().equals(ClickType.RIGHT);
    }

    public boolean isShiftRightClick(InventoryClickEvent event) {
        return event.getClick().equals(ClickType.SHIFT_RIGHT);
    }

    public boolean isNumberClick(InventoryClickEvent event) {
        return event.getClick().equals(ClickType.NUMBER_KEY);
    }

}
